package teleware.soe.core.context;

import teleware.soe.core.dto.MappingPool;
import teleware.soe.core.enums.MappingEnum;
import teleware.soe.core.factory.MappingStrategyFactory;
import teleware.soe.core.strategy.MappingStrategy;

import java.lang.reflect.Method;

/**
 * 映射策略上下文
 *
 * @author :hongsw
 * @date :2020-12-11 16:16
 */
public class MappingStrategyContext {
    public void process(MappingEnum mappingEnum, Method method, MappingPool mappingPool) {
        MappingStrategy mappingStrategy = MappingStrategyFactory.getMappingStrategy(mappingEnum);
        assert mappingStrategy != null;
        mappingStrategy.process(mappingEnum, method, mappingPool);
    }
}
